home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Sunday Times: The Month 2003 December
/
The Sunday Times - The Month 2003-12.iso
/
mac
/
The Month DEC 03
/
engine
/
modules
/
text_table.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2003-08-19
|
6KB
|
160 lines
function init()
{
build();
_visible = true;
onComplete();
}
function build()
{
var strID = Tardis.ActiveSection.id;
var Colors = Tardis.Colors;
strSECTION_COLOR = Colors.getString(strID);
SECTION_COLOR = Colors.getHex(strID);
SECTION_COLOR50 = Colors.getString(strID + "50");
DEFAULT_COLOR = Colors.getHex("default");
DEFAULT_COLOR50 = Colors.getHex("default50");
strDEFAULT_COLOR50 = Colors.getString("default50");
modWidth = nodeData.byName("dimensions").attributes.width;
txtWidth = modWidth - 12;
modHeight = nodeData.byName("dimensions").attributes.height;
ndItems = nodeData.byName("items");
ndDefault = nodeData.byName("default");
titleFF._width = txtWidth;
title2FF._width = txtWidth + 15;
if(nodeData.byName("title").getText() != null || nodeData.byName("title2").getText() != null || nodeData.byName("title3").getText() != null)
{
var strTitle = "<FONT COLOR=\"" + strSECTION_COLOR + "\">" + nodeData.byName("title").getText() + " </FONT>";
strTitle += "<FONT COLOR=\"" + SECTION_COLOR50 + "\"> " + nodeData.byName("title2").getText() + " </FONT>";
strTitle += "<FONT COLOR=\"" + strDEFAULT_COLOR50 + "\"> " + nodeData.byName("title3").getText() + " </FONT>";
titleFF.htmlText = strTitle;
titleFF._y = TEXT_POS;
titleFF.resize();
TEXT_POS += Math.ceil(titleFF._height - 3);
}
var strByline = nodeData.byName("byline").getText();
if(strByline != null)
{
title2FF.htmlText = strByline;
title2FF.textColor = DEFAULT_COLOR;
title2FF.resize();
title2FF._y = TEXT_POS;
TEXT_POS += Math.ceil(title2FF._height - 7);
}
attachMovie("tableElement568","tableHeadMC",Tardis.depth++);
tableHeadMC._x = 6;
var objText = tableHeadMC.textHolderMC;
objText.col1FF.htmlText = ndDefault.byName("col1").getText();
objText.col1FF.resize();
objText.col1FF.textColor = DEFAULT_COLOR;
objText.col2FF.htmlText = ndDefault.byName("col2").getText();
objText.col2FF.resize();
objText.col2FF.textColor = DEFAULT_COLOR;
objText.col3FF.htmlText = ndDefault.byName("col3").getText();
objText.col3FF.resize();
objText.col3FF.textColor = DEFAULT_COLOR;
objText.col4FF.htmlText = ndDefault.byName("col4").getText();
objText.col4FF.resize();
objText.col4FF.textColor = DEFAULT_COLOR;
objText.col5FF.htmlText = ndDefault.byName("col5").getText();
objText.col5FF.resize();
objText.col5FF.textColor = DEFAULT_COLOR;
objText.bgMC._height = objText.col5FF._height;
tableHeadMC.bgMC._visible = false;
tableHeadMC.bgMC._height = 0;
tableHeadMC._y = TEXT_POS;
TEXT_POS += tableHeadMC._height;
this.attachMovie("scrollContentMC","sMC",Tardis.depth++);
x = 0;
while(x < ndItems.childNodes.length)
{
sMC.attachMovie("tableElement568","mc_t_" + x,Tardis.depth++);
objClip = eval("sMC.mc_t_" + x);
objText = eval(objClip + ".textHolderMC");
objClip._y = CONTENT_POS;
objText.col1FF.htmlText = ndItems.childNodes[x].byName("col1").getText();
objText.col1FF.autosize = true;
var MAX_HEIGHT = objText.col1FF._height;
objText.col2FF.htmlText = ndItems.childNodes[x].byName("col2").getText();
objText.col2FF.autosize = true;
if(objText.col2FF._height > MAX_HEIGHT)
{
MAX_HEIGHT = objText.col2FF._height;
}
objText.col3FF.htmlText = ndItems.childNodes[x].byName("col3").getText();
objText.col3FF.autosize = true;
if(objText.col3FF._height > MAX_HEIGHT)
{
MAX_HEIGHT = objText.col3FF._height;
}
objText.col4FF.htmlText = ndItems.childNodes[x].byName("col4").getText();
objText.col4FF.autosize = true;
if(objText.col4FF._height > MAX_HEIGHT)
{
MAX_HEIGHT = objText.col4FF._height;
}
objText.col5FF.htmlText = ndItems.childNodes[x].byName("col5").getText();
objText.col5FF.autosize = true;
if(objText.col5FF._height > MAX_HEIGHT)
{
MAX_HEIGHT = objText.col5FF._height;
}
objText.bgMC._height = MAX_HEIGHT + 8;
objClip.bgMC._height = objText._height + 1;
objClip.bgMC._width = objText._width - 4;
objText.col1FF.textColor = objText.col2FF.textColor = objText.col3FF.textColor = objText.col4FF.textColor = objText.col5FF.textColor = DEFAULT_COLOR;
CONTENT_POS += objClip._height - 1;
x++;
}
var ndBodyLink = nodeData.byName("bodylink");
if(ndBodyLink.byName("title").getText() != null)
{
bodyLinkMC.contentFF.htmlText = ndBodyLink.byName("title").getText();
bodyLinkMC.contentFF.textColor = SECTION_COLOR;
bodyLinkMC.contentFF.autoSize = true;
bodyLinkMC.arrowMC._x = bodyLinkMC.contentFF._width + 5;
var arwColor = new Color("bodyLinkMC.arrowMC");
arwColor.setRGB(SECTION_COLOR);
bodyLinkMC.btn._width = bodyLinkMC.contentFF._width + bodyLinkMC.arrowMC._width;
}
else
{
bodyLinkMC.arrowMC._visible = false;
bodyLinkMC.btn._width = sMC.bodyLinkMC.btn._height = 0;
bodyLinkMC.btn.enabled = false;
bodyLinkMC.contentFF._height = 0;
}
if(sMC._height > modHeight - bodyLinkMC.contentFF._height - TEXT_POS)
{
this.attachMovie("FScrollPaneSymbol","contentScroll",Tardis.depth++);
attachMovie("textBgMC","MaskerMC",Tardis.depth++);
MaskerMC._height = 1;
MaskerMC._width = tableHeadMC._width;
contentScroll._x = 5;
contentScroll._y = TEXT_POS;
contentScroll.setSize(modWidth,modHeight - bodyLinkMC.contentFF._height - TEXT_POS);
contentScroll.setHScroll(false);
contentScroll.setScrollContent(sMC);
MaskerMC._x = 10;
MaskerMC._y = TEXT_POS;
TEXT_POS += contentScroll._height + 3;
title2FF._width = txtWidth;
title2FF.resize();
}
else
{
sMC.bodyFF._width += 10;
sMC.bodyFF.autoSize = true;
sMC._x = 8;
sMC._y = TEXT_POS;
TEXT_POS += sMC._height;
}
bodyLinkMC._y = TEXT_POS;
}
_visible = false;
stop();
SCROLLBOX_INIT_POS = 58;
TEXT_POS = 6;
CONTENT_POS = 0;
onReady();
v;